﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;

namespace G.Controls
{
    [TemplateVisualState(Name = "MouseOver", GroupName = "CommonStates")]
    [TemplateVisualState(Name = "Normal", GroupName = "CommonStates")]
    [TemplateVisualState(Name = "Click", GroupName = "CommonStates")]
    public class NormalButton : ButtonBase
    {
        public NormalButton()
            : base()
        {
            this.DefaultStyleKey = typeof(NormalButton);
        }

        protected override void OnClick()
        {
            base.OnClick();
            VisualStateManager.GoToState(this, "Click", false);
        }

        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            VisualStateManager.GoToState(this, "MouseOver", false);
        }
        protected override void OnMouseLeave(MouseEventArgs e)
        {
            base.OnMouseLeave(e);
            VisualStateManager.GoToState(this, "Normal", false);
        }
    }
}
